chore: bump AdCP schemas to beta.5#889
Merged
Merged
Conversation
| while cursor < len(content): | ||
| line_end = content.find("\n", cursor) | ||
| if line_end == -1: | ||
| line_end = len(content) |
| while cursor < region_end: | ||
| line_end = content.find("\n", cursor, region_end) | ||
| if line_end == -1: | ||
| line_end = region_end |
There was a problem hiding this comment.
LGTM. Schema-cache refresh with zero wire-shape delta; alias layer survives the renumbering churn by construction.
Things I checked
- No field-shape changes on the wire.
ad-tech-protocol-expertbyte-compared three bundled wire schemas (bundled/media-buy/create-media-buy-request.json,bundled/media-buy/get-products-response.json,bundled/creative/sync-creatives-request.json) betweenschemas/cache/3.1.0-beta.4/and3.1.0-beta.5/. Identical modulo_bundled.generatedAt, includingrequired, top-level properties, and$defskeys. The emptySCHEMA_DELTAS.mdis correct, not a tooling failure. - Alias-layer integrity. Every numbered class imported by
aliases.py(AccountReference1/2,CreateMediaBuyResponse1/2/3,Deployment1/2,Destination1/2,AuthorizedAgents1..6,CatalogFieldBinding1,Field1) is present at matching positions in the regenerated_generated.py. The renumber churn (Signal81 → Signal,PricingOption341 → PricingOption211, etc.) lives in unaliased flat enum classes — true renumbering churn per the CLAUDE.md warning, no semantic delta. chore:semver signal is correct.ADCP_VERSIONis the protocol pin, not the SDK semver.aliases.py,capabilities.py,_ergonomic.py,_forward_compat.py,__init__.pyall unchanged. No public Python API surface change.- Beta.4 cache preserved. 675 files added under
schemas/cache/3.1.0-beta.5/, zero modified or removed underschemas/cache/3.1.0-beta.4/. Downstream tests pinned to beta.4 still resolve. - Layering rule held. Generated churn is confined to
src/adcp/types/generated_poc/**and_generated.py. No non-allowlisted module gained an import from generated_poc.
Follow-ups (non-blocking — file as issues)
add_rootmodel_getattr_proxyswapped AST for regex and lost a robustness property (scripts/post_generate_fixes.py:543-600). The insertion point is computed asnext_class.start()orlen(source). If datamodel-codegen ever emits a module-level statement between a RootModel union class and the next class (e.g.,FooAlias = FooUnion),source[:offset].rstrip()leaves the alias line intact and visually attaches the 4-space-indenteddef __getattr__to it —IndentationErrorat module scope. I checked the current beta.5 generated tree and no RootModel union is followed by module-level code, so this is latent, not active. But the AST predecessor was robust to that shape; the regex version is not. Cheapest fix: keep AST for this one function — single per-file parse is small next to the rglob cost.fix_deprecated_rootmodel_fieldsskips the first line of the annotation block (scripts/post_generate_fixes.py:1515-1521)._find_class_field_blockreturnsstart = annotation_start = cursor + len(" root: "), which is mid-line. The line-clear loop'sline_start < start: continuealways skips that first line. For multi-line RootModelroot: Annotated[...annotations (what codegen currently emits),deprecated=Trueis never on that line. If codegen ever producesroot: Field(deprecated=True, ...)single-line, Pydantic rejects it and this fix won't strip thedeprecated=True. Worth tightening to a line-coverage check that doesn't require strict-less-than against a mid-line offset.add_deprecated_field_metadatasubstring matcher loosened fromAnnotated[…]Field(toField(substring (scripts/post_generate_fixes.py:282-285). Strictly more permissive than the predecessor. Currently fine — no deprecated field's annotation contains aField(-suffixed identifier — but\bField\(would restore the prior precondition at near-zero cost.- SCHEMA_DELTAS.md is overwrite-only by design (
scripts/diff_generated_types.py:202), so the beta.3→beta.4 delta the previous version recorded is gone from git history's working tree representation. For audit purposes, future bumps should fold the per-version delta intoCHANGELOG.mdso the cumulative trail survives the next regen.
Minor nits (non-blocking)
add_rootmodel_getattr_proxyanchors on:\nto find the class header end (scripts/post_generate_fixes.py:573). Works because datamodel-codegen always emitsclass Foo(...):\n. A header ending in a trailing comment would break it. Anassertor comment recording the assumption would make the dependency explicit.- Conventional-commit title only narrates half of the PR.
chore: bump AdCP schemas to beta.5covers the version pin and the regen; the 333-line refactor inscripts/post_generate_fixes.pyis independent perf work and is mentioned in the body but not the title. Not a semver issue — both pieces arechore:/refactor:grade — but the next reader ofgit log --onelinewon't see that this commit also touched the build script. Notable for an otherwise-clean schema-bump PR; future bumps benefit from splitting.
Safe to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Compatibility
Beta.5 is treated as its own schema contract, not as a beta.4 wire-compatible alias. The generated type delta report shows no beta.4 -> beta.5 field-shape changes.
Validation